package com.example.demo;

import java.util.Arrays;
import java.util.stream.Stream;

/**
 * @author yishuangshuang
 * @ClassName: ArrayDemo
 * @Description: TODO
 * @date 2019/1/3 2:05 PM
 */
public class ArrayDemo {
    public static void main(String[] args) {
        Integer[] ret = {1,2,1,2,1,2};
        Long sum = Stream.of(ret).filter(ints -> ints.equals(1)).count();
        System.out.println(sum);

        int[] sss = {1,2,1,2,1,2};
//        Stream.of(sss).map(Integer::valueOf).
        long m = Arrays.stream(sss).filter(i -> i == 1).count();
        System.out.println(m);
    }
}
